<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:rich="http://richfaces.org/rich">
<h:head>
	<title>Fiap Airport Web</title>
</h:head>
<h:body>
	<ui:include src="/cliente/menu.xhtml"/>
	<rich:panel header="Lista de Trechos">
	<h:form>
		
		<c:if test="${not empty trechoBean.trecho.id}">
			<div>
				<span>Código:</span>
				<h:inputHidden value="#{trechoBean.trecho.id}" />
				<h:outputLabel value="#{trechoBean.trecho.id}" />
			</div>
		</c:if>
		<div>
			<span>Descrição:</span>
			<h:inputText value="#{trechoBean.trecho.descricao}" />
		</div>
		<div>
			<span>Data:</span>
			<rich:calendar value="#{trechoBean.trecho.data}" required="true">  
			   <f:convertDateTime pattern="dd/MM/yyyy"/>  
			</rich:calendar>
		</div>
		<div>
			<span>Voo:</span>
			<h:selectOneMenu value="#{trechoBean.trecho.voo.numero}" required="true">        
				<f:selectItem itemValue="" itemLabel="Selecione" />      
			    <f:selectItems value="#{trechoBean.voos}" />
			</h:selectOneMenu>
		</div>
		<div>
			<span>Valor:</span>
			<h:inputText value="#{trechoBean.trecho.valor}" required="true" />
		</div>
    	<p>
			<h:commandButton action="#{trechoBean.salvarDados()}" value="Salvar" />
			<h:commandButton action="lista-trecho" value="Voltar" immediate="true" />
		</p>
	</h:form>
		</rich:panel>
</h:body>
</html>
